<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    ul,
    ol,
    li {
      list-style: none;
    }

    .tab-header {
      border-bottom: 1px solid red;
    }

    .tab-header ul {
      overflow: hidden;
      height: 60px;
    }

    .tab-header li {
      float: left;
      height: 40px;
      line-height: 40px;
      position: relative;
      bottom: -20px;
      background-color: #aca3a3;
    }

    li.active {
      height: 60px;
      line-height: 60px;
      background-color: #ff0;
      bottom: 0px;
    }
  </style>
</head>

<body>

  <div id="app">
    <div class="tab-layout">
      <div class="tab-header">
        <ul>
          <li :class="[tabheader==='first'?'active':'']" name="first" @click="switchTab($event)">HOME</li>
          <li :class="[tabheader==='second'?'active':'']" name="second" @click="switchTab($event)">HTML</li>
          <li :class="[tabheader==='third'?'active':'']" name="third" @click="switchTab($event)">CSSA</li>
        </ul>
      </div>
      <div class="tab-body">
        <div v-if="tabheader === 'first'" name="first">home</div>
        <div v-else-if="tabheader==='second'" name="second">html</div>
        <div v-else name="third">css</div>
      </div>
    </div>

  </div>

  <script src="./js/vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        tabheader: 'first'
      },
      methods: {
        switchTab(e) {
          let n = e.target.getAttribute('name');
          this.tabheader = n;
        }
      }
    });


  </script>
</body>

</html>